<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.a{
				width: 100px;
				height: 50px;
				background: black;
			}
		</style>
	</head>
	<body>
		<div id="oDiv" class="a"></div>
		<select id="t">
			<option value="red">红色</option>
			<option value="yellow">黄色</option>
			<option value="blue">蓝色</option>
		</select>
		<button onclick="change()">变色</button>
		
		<script>
			function change(){
				document.getElementById('oDiv').style.background = t.value;
			}
		</script>
	</body>
</html>